package chapter15;

/**
 * @Auther: Tx
 * @Date: 2022/5/26 20:49
 */
public class Generic02 {
    public static void main(String[] args) {
        Person<String> person = new Person<String>("hsp");
        person.show();
        Person<Integer> person1 = new Person<Integer>(100);
        person1.show();
    }
}

class Person<E> {
    E s;

    public Person(E s) {
        this.s = s;
    }

    public E f1() {
        return s;

    }
    public void show(){
        System.out.println(s.getClass());
    }
}